package br.mg.bhe.vertice;

import java.io.File;

public class ConversionHandler {

  private ConversionHandler() {
    super();
  }
  
  public static String convert(File file, String ext) {
    if (ext == null || ext.isEmpty()) {
      ext = "pdf";
    }
    
    String converted = "/tmp/" + file.getName() + "." + ext;
    
    Utils.exec("java -jar lib/jodconverter-cli-2.2.2.jar " + file + " " + converted);
    
    return converted;
  }
}
